#include "common.h"
#include "actor.h"
#include "buff.h"
#include "item.h"

bool ActorPrioritySorter::operator()( const Actor* less, const Actor* greater ) const
{
    return Actor::PrioritySort( less, greater );
}

bool BuffPrioritySorter::operator()( const Buff* less, const Buff* greater ) const
{
    return Buff::PrioritySort( less, greater );
}

bool ItemPrioritySorter::operator()( const Item* less, const Item* greater ) const
{
    return Item::PrioritySort( less, greater );
}

uint GetDirection( uint input )
{
    uint r = 0;
    if ( input == INPUT_UPARROW || input == '8' )
        r = 8;
    if ( input == INPUT_LEFTARROW || input == '4' )
        r = 4;
    if ( input == INPUT_DOWNARROW || input == '2' )
        r = 2;
    if ( input == INPUT_RIGHTARROW || input == '6' )
        r = 6;
    if ( input == '1' )
        r = 1;
    if ( input == '3' )
        r = 3;
    if ( input == '5' )
        r = 5;
    if ( input == '7' )
        r = 7;
    if ( input == '9' )
        r = 9;
    return r;
}